import { createApp } from 'vue';
import { createPinia } from 'pinia';
import router from './router';
import App from './App.vue';

// 样式导入
import 'vant/lib/index.css';
import '@/styles/index.scss';

import {
  Button,
  Field,
  Form,
  CellGroup,
  NavBar,
  Toast,
  Tabbar,
  TabbarItem,
  Swipe,
  SwipeItem,
  Grid,
  GridItem,
  Card,
  Tag,
  Cell
} from 'vant';

const app = createApp(App);

// 注册Vant组件
const vantComponents = [
  Button,
  Field,
  Form,
  CellGroup,
  NavBar,
  Toast,
  Tabbar,
  TabbarItem,
  Swipe,
  SwipeItem,
  Grid,
  GridItem,
  Card,
  Tag,
  Cell
];

vantComponents.forEach(component => {
  app.use(component);
});

app.use(createPinia());
app.use(router);

app.mount('#app');
